home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-10-31 | 37.4 KB | 954 lines | [TEXT/MPS ] |
- #
- # MPButtons 2.2 User's Guide
- # (describes release 2.2.0, November 1996)
- #
- # (c) 1993 JMP Soft, 1996 Soften
- #
-
-
- ————————---———————
- 1. About MPButtons
- ————————---———————
- MPButtons is a development utility providing a set of extensions to the MPW
- environment. Some of its features include:
- - searching for strings using a single click
- - multiple smart clipboards with copy, paste, cut, swap and executable
- contents
- - tool for commenting and uncommenting a portion of source code
- - function name popup, providing source overview and quick navigation
- - searching and pasting items from Toolbox Assistant or THINK Reference 2.0
- - API for adding custom functionality
-
- Each feature typically appears as a button at the top of an MPW window and
- can be used by mouse clicks or by using keyboard shortcuts.
-
- MPButtons provides:
- - one always visible button — Selection
- - up to seven optional Clipboard Buttons
- - six optional Custom Buttons: Find, Comment, Function, Prototyper,
- Reference button and Script Button Example
- - you can find some other buttons in the More Buttons folder
-
- MPButtons offers a large number of convenient functions. To help you to
- memorize most of them and to prevent your confusion an extensive quick
- reference is offered by balloon help. Complete description you can find in
- this file — table of contents is in the Mark menu.
-
- Soon you will notice the natural distribution of power between three main
- MPButtons tools:
-
- 1. Clipboards
- 2. Script Buttons
- 3. Code Buttons
-
- While the first tool is any time ready to hold and execute short sequence of
- MPW commands, the second tool enables to design and store (in the form of
- "button" with unique icon) more complex tasks, and the last tool is able to
- do any task - but it needs some effort, of course.
-
- This guide is organized according to buttons and actions you can do with each
- button. Typical paragraph begins for instance with the title "Option -
- Click" followed by description what will happen, when you option-click on
- a given button.
-
-
-
- ——————————————---——
- 2. Selection Button
- ————————————---————
- Selection Button is the first button from the left on the button bar with a
- selection icon (§).
-
-
- Click
- Scrolls the contents of the window so that you can see cursor or beginning
- of the current selection (this is a shortcut to the Display Selection
- command in the MPW Find menu).
-
-
- Press
- Popup menu with four items: Clips, Rebuild, About, Deinstall.
-
- • Clips item has a submenu with numbers 0, 1,… 7; select the number of
- clipboards you want to use. Choosing zero will hide all the clipboard
- buttons. See the Clipboard Buttons mark for more information about using
- clipboard buttons. Each change in number of clipboards invokes Rebuild
- - see next.
-
- • Rebuild command reloads Custom Buttons into the button bar according to
- current contents of the MPButtons folder. See the Custom Buttons mark.
-
- • About command shows the (surprise!) about box with contact.
-
- • Deinstall gives you an alert. When you confirm, MPButtons will be
- permanently deinstalled from the MPW Shell.
-
-
-
-
- ———————————---——————
- 3. Clipboard Buttons
- ———————————---——————
- User-selectable number of buttons with a clipboard icon. You can change the
- number of Clipboard Buttons (including 0) by pressing the Selection Button
- and choosing from the Clips submenu. By reducing the number of clips the
- contents of all hiding Clipboard Buttons are lost.
-
- Each button offers its own clipboard, independent of all other MPButtons
- clipboards and the system clipboard. Each of MPButtons clipboard is global
- for all open MPW documents — its contents does not change by switching
- files. The contents of clipboards is saved (up to 10Kbytes each) in the
- MPButtons preferences file and will be available in your next MPW session.
-
- In addition to copy, cut and paste functions you can execute commands stored
- in the MPButtons clipboards with the same results as if it was entered
- directly from the active MPW window. You can prepare different commands in
- different Clipboard Buttons. When you use some standard command sequences,
- try Script Buttons.
-
- The Clipboard Buttons and their respective functions rely heavily on the use
- of modifier combinations. The number of combinations used in mouse actions
- and shortcuts might seem confusing but there are a few rules, which can help
- you to remember the proper combination of modifier keys:
- - Click pastes
- - Control copies
- - Option cuts
- - Shift adds
- - Command + n, where n is a numerical key, is a keyboard equivalent for
- Click (note that you can use the clipboards without actually clicking the
- respective button, by using a keyboard shortcut. See further description
- of keyboard shortcut assignment).
-
- In the next detailed section MPButtons shortcuts are enclosed in parentheses.
- The lower case letter 'n' represents a clipboard number (from 1 to 7) and a
- respective numerical key on the keyboard.
-
-
- Click (Command + n) = Paste
- Pastes the clipboard contents to the active document.
-
- If the clipboard is empty you will hear a beep. You can easily check the
- status of the clipboard: nonempty Clipboard Button has piece of paper in the
- clip on its icon.
-
-
- Control - Click (Control + Command + n) = Copy
- Copies the current selection into the clipboard.
-
- If there is no selection, the clipboard is emptied and the button icon
- changes. This can be used for emptying the clipboard.
-
-
- Option - Click (Option + Command + n) = Cut
- Cuts the current selection and replaces the clipboard contents with it.
-
-
- Shift - Control - Click (no shortcut) = Swap
- Interchanges the clipboard contents and the current selection.
-
-
- Shift - Click (no shortcut) = Append
- Appends the selection to the end of the clipboard contents.
-
-
- Control - Option - Click (Control + Option + Command + n) = Execute
- Executes the MPW commands stored in the clipboard (cool!!). This way you can
- prepare several MPW script commands into your clipboards and execute them by
- Control - Option - Clicking on the respective Clipboard Button.
-
-
- Control - Option - Command - Click (no shortcut)
- Executes MPW commands stored in the clipboard using Commando.
-
-
- Press
- Shows the contents of the clipboard.
-
-
- Redefining the keyboard shortcut equivalents
-
- The MPButtons core defines four new sets of editor primitives for four main
- clipboard actions. These primitives are named
-
- MPBCopy1..MPBCopy7 (copy to clipboard 1..7)
- MPBPaste1..MPBPaste7 (paste clipboard 1..7)
- MPBCut1..MPBCut7 (cut to clipboard 1..7)
- MPBDo1..MPBDo7 (execute clipboard 1..7)
-
- This allows you to modify predefined shortcuts using the SetKey command in a
- way, consistent with the MPW shell. For instance after setting
-
- SetKey Command-Q MPBPaste3
-
- you can paste the contents of the 3rd clipboard using the shortcut
- Command - Q (by the way, this example is not a very smart shortcut selection).
-
-
-
-
- ———---————————
- 4. Find Button
- ——————---—————
- Find Button is a Custom Code Button (see the Custom Buttons mark) with an
- eye icon. It offers an extension to the original MPW Find functions.
- MPButtons shares the find buffer with MPW — you can take advantages of the
- MPW find with all its features and shortcuts.
-
-
- Click
- Copies the current selection into the find buffer (if there is any
- selection) and searches the current file for the contents of the find
- buffer. Clicking the upper part of the button will search backward, the
- lower part searches forward.
-
- If there is no selection the MPButtons searches for the current find buffer
- contents. If the find buffer is empty the Find dialog box is displayed.
-
- Clicking the lower part of the Find Button is functionally equivalent to the
- MPW shortcut Command-H (respectively Command-G if there is no selection) and
- clicking the upper part of the Find Button is functionally equivalent to the
- MPW shortcut Shift-Command-H (respectively Shift-Command-G if there is no
- selection).
-
-
- Option-click
- The same as Click but does not modify the find buffer: searches the current
- file for the contents of the find buffer regardless to the current selection.
- This is a faster equivalent to first deselecting the current selection and
- then clicking the Find Button (or pressing the MPW Command-G shortcut). Once
- again, the upper part of the button searches backward, the lower part searches
- forward.
-
-
- Command-click (Option + Command + H forward or Shift + Option + Command + H backward)
- The same as click (searches for selection) but preserves the current
- selection. The string that is found is hilited for a moment and stays
- visible in the window. The current selection remains unchanged, you can
- return to it by clicking on the Selection button.
-
-
- Option-Command-click (Option + Command + G forward or Shift + Option + Command + G backward)
- The same as Option-click (searches for buffer contents) but preserves the
- current selection. The string that is found is hilited for a moment and
- stays visible in the window. The current selection remains unchanged, you
- can return to it by clicking on the Selection button.
-
-
- Press
- Displays the popup menu with the last ten searched strings. If you select
- one of them it replaces the find buffer and is searched for. Also, after you
- display the popup next time you can see that this selected string became
- the first item (the first item indicates the latest searched string).
-
-
- Control-press
- Shows the string that could be searched for by immediately following click;
- no search is performed.
-
- If there is a nonempty selection it is shown. Now you can alter the find
- buffer contents: if you release mouse inside the Find Button the current
- selection replaces the find buffer. If you release mouse outside the Find
- button the find buffer contents remains unchanged.
-
- If there is no selection the find buffer contents is shown. If the find
- buffer is empty you can see a warning message.
-
-
- Option-Control-press
- Shows the find buffer contents regardless to the current selection. If the
- find buffer is empty you can see a warning message.
-
-
-
- ———-—————————————
- 5. Comment Button
- ————-————————————
- Comment Button is a Custom Code Button (see the Custom Buttons mark) with
- one string of comment characters in the button icon (#, ;, /*, // or {}). It
- helps to comment or uncomment a selection. Can be used for disabling parts
- of source code and for formatting plain text into multiple line comments.
-
- The comment characters in the Comment Button icon changes, depending on
- the type of the source file in the active window (can be changed
- manually, see the mark Comment types).
-
-
- Click (Control + Command + C)
- Comments or uncomments the current selection. If the selection contains at
- least one newline character it expands to whole lines. Uncommenting takes
- effect if the selection starts with the opening sequence of comment
- characters of given type (see the mark Comment types).
-
- In C and Pascal comment types MPButtons preserves pairing of open and close
- comment characters. When you comment a selection containing original
- comments, they change into nested comments using bullets (•) and angle
- bracket characters and can be therefore distinguished from MPButtons
- comments. Example in Pascal:
-
- { if w in ['a','e','i','y','o','u'] then <•vowels•>}
- { begin}
- { inc( nw);}
- { next( w)}
- { end;}
-
- After uncommenting you'll get the original comments:
-
- if w in ['a','e','i','y','o','u'] then {vowels}
- begin
- inc( nw);
- next( w)
- end;
-
- MPButtons will not comment a selection with incomplete comments.
-
-
- Shift - Click
- Extends the current selection to whole lines and closes it into IFDEF/ENDIF
- lines. Only for C, C++ and Pascal comment types. Example in Pascal:
-
- {$IFC DEBUG}
- if w in ['a','e','i','y','o','u'] then
- begin
- inc( nw);
- next( w)
- end;
- {$ENDC}
-
- The default ifdef string is set to DEBUG and can be freely modified using
- "Set ifdef §" command — see the mark Comment types.
-
-
- Command - Click
- # Helps to format multiline comments. This and next four paragraphs show results
- # of command-clicks on the Comment button with all possible comment types (see
- # the mark Comment types on how to select the comment type).
-
- ; The function expands the selection to whole lines, strips comment signs,
- ; breaks the selection like a typical text processor does, and finally closes
- ; every line separately into comment signs. • Warning • All comment characters
- ; of chosen type are stripped including those not used as comment signs.
-
- /* The whole selection is expected to be only one paragraph. If your comment */
- /* contains more then one paragraph, you need to break every paragraph */
- /* separately. */
-
- // In C and Pascal comment types spaces are inserted between the last character
- // of a line and the closing sequence of comment characters. Right margin is set
- // to column 80. (Monospaced font like Monaco is expected.)
-
- { By the way, this file was finally formatted by command-click and click }
- { sequence on each selected paragraph. Command-click broke a paragraph and }
- { next click striped comment signs. }
-
-
- Press
- Pressing the Comment Button presents a popup menu with comment types (MPW,
- Assembler, C, C++ and Pascal). The last item is "Set ifdef §" command, see
- later.
-
- No commenting or formatting is performed as a result of pressing the
- comment button.
-
- The active comment type (that is marked in popup menu) can be overridden by
- choosing another type from the popup menu. The type of commenting changes not
- only the comment characters, but it also affects the ifdef and formatting
- features. Type of commenting is a local feature in each MPW file and is saved
- with the file.
-
- • Note • By default, the commenter picks the type of commenting depending on
- the source file name suffix. In the button's resources of type 'SUFX' there
- are defined file name suffixes for specific languages. The TMPL resource is
- provided, so you can easily add your own suffix or just modify an existing
- one using your favourite resource editor.
- Java source files have assigned the C style of comments. MagicCap sources
- have assigned the C++ style of comments.
-
- To change the ifdef string:
- (1) type the string in an active window and select it,
- (2) press the Comment button and choose the "Set ifdef §" command.
- From now on every shift-click will use the new ifdef string.
-
-
-
-
- ——————————————————
- 6. Function Button
- ——————————————————
- Function Button is a Custom Code Button (see the Custom Buttons mark) with
- a small popup menu icon. This button is designed to help you navigate through
- the source files. It displays a popup menu of functions in the current
- document. Currently, the following file types are supported:
-
- • C/C++
- • MagicCap
- • Pascal
- • FORTRAN
- • Assembler (68k, PPC)
- • Java
-
- Selecting an item from the popup menu will select the appropriate function
- name. It also allows to step forward or backward over function names. In
- addition to displaying functions, the Function Button displays various
- other items, such as structs, typedefs, enums and classes in C++, etc.
-
-
- Click (Control+Command+F forward and Shift+Control+Command+F backward)
- Moves to the previous/next function in the source file from the current
- cursor position. If there are no more functions in the chosen direction,
- Function Button beeps. The button is split into two halves to enable the
- backward/forward browsing.
-
-
- Command - Click
- Moves to the previous/next function in the source file but preserves the
- current selection. Then you can go back using the Selection button. This
- feature is useful when you want just to have a quick look at the
- previous/next function without changing the selection.
-
-
- Option - Click (Control + Option + Command + F)
- Searches the file for the current selection used as a function definition.
- Beeps if not successful.
-
-
- Press
- Displays a popup menu of functions in the current file. In the popup menu,
- the check mark indicates that cursor (or selection start) is in the marked
- function. If the current document contains no functions a popup menu with a
- dimmed "no function definitions" item appears. The suffix in the name of the
- document determines which language will be used for searching for functions
- in the document. See following section on information on how to configure
- it.
- When encountering overloaded functions in C or C++, the function popup
- displays the functions parameters to help distinguish between different
- overloaded functions using the same function name.
-
-
- Shift - Press
- When using the Shift modifier, some additional information will appear in
- the function popup:
-
- • Function arguments (in abbreviated form)
- • Function prototypes
- • Struct, enum, union, class and type definitions
-
-
- Control - Press
- While pressing the Control modifier the class member functions are
- displayed.
- Note: This is valid only in C++ and MagicCap files.
-
-
- Control - Option - Press
- The same as Control-Press but the popup menu is sorted alphabetically.
-
-
- Option - Press
- While pressing the Option modifier the popup menu is sorted alphabetically.
-
-
- Command - Press
- If you select a function name in the popup menu while pressing the Command
- key the function is displayed but not selected (the current selection
- position remains unchanged). Then you can go back using the Selection
- button. This feature is useful when you want just to have a quick look at
- the specific function without changing the selection.
-
-
-
- Configuring the Function Button
- ———————————————————————————————
- The language used for looking for functions in the current document is
- derived from the suffix of the name of the document. The resources of type
- 'SUFX' in the Function button file contain the mapping information used to
- determine a specific language. You can append your own filename suffixes to
- these resources.
-
-
-
- —————————————
- 7. Prototyper
- —————————————
-
- In addition to usual prototyping of C functions, the prototyper provides a
- number of functions that ease C++ coding.
-
- Feature overview:
- -----------------
-
- Prototyping - generating C and C++ function prototypes.
- Inverse prototyping - generating empty functions from function prototypes or
- C++ classes.
- Inline extraction - removes inline function code from inside C++ classes and
- lets the user paste the inlines outside the class.
-
-
- C function prototyping:
- -----------------------
-
- select:
-
- void
- a(int b)
- {
- int c = b;
- }
-
- click prototyper button, get:
-
- extern void a(int b);
-
- Select one or more functions and click the prototyper button. If the
- selected functions are valid, you will notice that the prototyper button
- will change to a loaded state. You can select any part of a function to
- include it's prototype.
-
- Pressing on the button will display the prototypes waiting to be pasted into
- your source file.
-
- Control clicking will clear out the prototyper clipboard and will let your
- generate new prototypes.
-
- Clicking on the prototyper button will paste the prototypes from the buttons
- clipboard into the current selection.
-
- The prototyper only for static functions. However, if you press the option
- key while clicking the prototyper button, prototypes of static functions
- will also be generated. If you only select static functions and do not hold
- down the option button while pressing the prototyper button, the button will
- remain empty.
-
-
- C++ function prototyping:
- -------------------------
-
- select:
-
- void
- SomeClass::SomeMemberFunction(int a, void b)
- {
- int c = a;
- b = 0;
- }
-
- click prototyper button, get:
-
- void SomeMemberFunction(int a, void b);
-
-
- When prototyping C++ member functions the resulting prototype is indented by
- a single tab, ready to be pasted into the corresponding C++ class.
-
-
- Appending prototypes:
- ---------------------
- shift-click
-
- If your prototyper buttons contains prototypes that are ready to be pasted,
- you can add more prototypes to the same batch by selecting functions and
- shift clicking the prototyper button. The prototyper will now contain the
- previous prototypes as well as new ones you just added. Clicking on the
- prototyper button will paste them all at once into the current selection.
-
-
- Inverse prototyping:
- --------------------
-
- select:
-
- extern void a(int b);
-
- click prototyper button, get:
-
- void
- a(int b)
- {
- }
-
- If you select function prototypes and click the button the prototyper will
- generate inverse prototypes - empty functions ready to be filled out with
- code.
-
-
- Inverse C++ function prototyping:
- ---------------------------------
-
- select:
-
- class a
- {
- public:
- virtual int a(int i);
- void a(int i, int j) const;
- short b(int i);
- };
-
- click prototyper button, and the prototyper clipboard contains this:
-
- inline int
- a::a(int i)
- {
- }
-
- inline void
- a::a(int i, int j) const
- {
- }
-
- inline short
- a::b(int i)
- {
- }
-
- Inverse prototyping is very useful for C++ programming where it's common to
- first design class definitions and then write the actual code. When you are
- done with the class definition, you select it, click the prototyper button,
- paste the prototypes into your source file and fill out the code. This would
- otherwise take multiple copy-paste steps and editing.
-
- The prototyper appends inline to each of the inverse prototypes, if you want
- a give function to be out of line, you need to remove the directive.
-
- By default the prototyper will not generate inverse prototypes for, pure
- virtual functions and functions that are inlined inside the class
- definition, since it is likely that you will not be adding any code to
- these. If you want to also generate inverse inlines for two above cases,
- hold down the option key while pressing the prototyper button.
-
- Generating inverse prototypes for C++ templates:
-
- select this:
-
- template<class StringKey, class Value>
- class StringKeyEntry: public StringKey
- {
- public:
- Value value;
- void setValue(const Value &v)
- int compare(const char *k) const;
- };
-
- click the prototyper and get this:
-
- template<class StringKey, class Value>
- void
- StringKeyEntry<StringKey, Value>::setValue(const Value &v)
- {
- }
-
- template<class StringKey, class Value>
- int
- StringKeyEntry<StringKey, Value>::compare(const char *k) const
- {
- }
-
- Two mouse clicks generate the equivalent of a tedious and error-prone
- copy-paste-edit sequence.
-
-
- Inline extraction:
- ------------------
-
- select this:
-
- class a : public b
- {
- public:
- a(int i) : b(i), x(i) { y = 0; }
- private:
- int x, y;
- };
-
- shift-option click the prototyper, the prototyper clipboard contains this:
-
- inline
- a::a(int i)
- : b(i),
- x(i)
- {
- y = 0;
- }
-
- When selecting a C++ class with inlines the generated prototypes contain the
- inline code.
-
- By holding down command while clicking the prototyper button, inline
- functions are also removed from the class definition:
-
- class a : public b
- {
- public:
- a(int i) : b(i), x(i) { y = 0; }
- private:
- int x, y;
- };
-
- shift-option click the prototyper, the class becomes:
-
- class a : public b
- {
- public:
- a(int i);
- private:
- int x, y;
- };
-
- and the prototyper clipboard contains this:
-
- inline
- a::a(int i)
- : b(i),
- x(i)
- {
- y = 0;
- }
-
- This feature is useful for formatting existing C++ code to your taste.
- Including inlines into the class definition is a little faster to type than
- writing separate inline functions but may make the class hard to read. Using
- the inline extraction feature you can write the class fast and then extract
- the inlines and paste them separately.
-
-
- Modifier key overview:
- ----------------------
-
- control - clear prototyper clipboard
- option - prototype everything, including static functions, pure virtual
- functions, inline functions in class definition
- command - extract inlines
- shift - append new prototypes to prototyper clipboard
-
-
-
- ———---—————————————
- 8. Reference Button
- ——————---——————————
- This is a Custom Code Button with spectacles icon. Searches for the
- reference in Toolbox Assistant or THINK Reference 2.0 (let's call the
- selected application generally 'reference application') and optionally
- pastes the template. You have to have a copy of reference application (or
- just its alias) installed on the same volume as your MPW Shell is running.
- The reference application will be automatically launched by the button.
-
-
- Click (Command + minus)
- Searches for the selected item in the reference application. If there is no
- selection and cursor is in a word then this word is selected automatically.
- The reference application is activated and the appropriate reference is
- displayed. If the reference application can't be found or can't be run or
- the selected item has no reference the button beeps.
-
-
- Option - Click (Option - Command - minus)
- Searches for the selected item in the reference application and replaces the
- selection by the template found for this item. See Click above for the
- button behavior.
-
-
- Press
- Pressing the Reference Button presents a popup menu for selecting the
- reference application. You can select Toolbox Assistant or THINK Reference.
-
-
-
- ———---———————————
- 9. Custom Buttons
- ——————---————————
- There are two kinds of Custom Buttons - Script Buttons and Code Buttons.
- Script Buttons contain MPW scripts and can have some additional features.
- Code Buttons are extensions which communicate with the MPButtons core
- through a predefined API. Each Custom Button can have 1, 2, or 4 sections
- with different purposes.
-
- Custom Button can be easily added/removed to/from the MPButtons bar by
- adding/removing the button file with puzzle icon to/from "MPButtons" folder
- (inside your "{ShellDirectory}" folder) and “rebuilding” the button bar.
-
- When MPW Shell is launched, or when the Rebuild command (from the Selection
- button) is invoked, or when you change the number of clipboards, MPButtons
- core looks for files with type 'TEXT' (Script Buttons) or type 'CBtn' with
- creator 'MPS ' (Code Buttons) in "MPButtons" folder. When MPButtons finds a
- button, it attempts to install it into the MPButtons bar. If installation is
- successful, the button appears in the bar and is ready to use.
-
- • Note • Custom Buttons are ordered alphabetically in the button bar. You
- can rearrange the position of each Custom Button by preceding the name with
- a digit: '1Function', '2Comment', etc.
-
-
-
- 9.1 Script Buttons
- ————----——————————
- Script Buttons are in fact MPW scripts with some optional features. For
- occasion command executing see Clipboard Buttons; on the other side more
- power you can get from Code Buttons.
-
- Every script file can be used as a Script Button. Make sure the file is an
- MPW script file, move it to the MPButtons folder and rebuild MPButtons (see
- the mark Selection Button - Rebuild).
-
- When you click on the new installed button in the MPButtons bar (it has a
- default icon), the appropriate script is executed. When you press the
- button, you'll see the content of the script.
-
- A Script Button may contain lines with '#MPB' keyword at the beginning - these
- lines are skipped in a normal script since they start with the '#' character.
- These lines have special meaning for the MPButtons core. They indicate that a
- special command follows. This command can be one of the following:
- #MPB AREA <number 0-3>
- #MPB MODIFS <modifier combination>
- #MPB SHORTCUT <SetKey-like key combination>
-
-
- #MPB AREA <number 0-3>
- This command divides the script into two or four sections. Each section is
- executed when appropriate section of the button is clicked. If the section of
- a button is pressed, the content of that area in the script is shown. "Areas"
- are identified the following way:
-
- +---+ +---+ +-+-+
- | | | 0 | |0|1|
- | 0 | +---+ +-+-+
- | | | 1 | |2|3|
- +---+ +---+ +-+-+
-
- AREA commands with a number greater than 3 just mark the end of the previous
- area command, but are not used for identifying an area. The button is divided
- according to the highest section number in the text, i.e. if the button text
- contains only one area command AREA 3, the button will be still divided into
- four parts, although only the bottom-right part will have an "action" on it.
-
- When no MPB AREA is defined, whole text is supposed to be in area 0.
-
-
- #MPB MODIFS <modifier combination>
- This command begins the section of each button area which will be executed
- when you click on the appropriate button section with specified modifiers. The
- button section which is located between the AREA command and the first MODIFS
- command will be executed when no modifiers are pressed.
-
-
- #MPB SHORTCUT <SetKey-like key combination>
- This command has a slightly different behavior than the previous ones. It
- marks a global position in the text (no matter in which section it is). Text
- following this command up to the next #MPB command will be executed when you
- press the defined shortcut. When you place the same SHORTCUT command at
- several locations in the script, the last one will be used when you press
- the shortcut. The notation for describing the shortcuts is
- "hyphen-divided-modifiers-and-key" (i.e. "Command-Control-Option-Q").
-
- #MPB SHORTCUT lines are ignored by the AREA and MODIFS commands. You can
- define the SHORTCUT command in the middle of the AREA and that area will
- continue after that line. If you define the SHORTCUT just after the MODIFS
- command, the following action will be invoked when you click on the button
- with the defined modifiers and ALSO when you press the defined shortcut.
-
-
- The #MPB are designed to be flexible and it's the users responsibility to
- use them in a reasonable way.
-
- See the files "Script Button Example" and "Funny Script Button" to learn how
- Script Buttons work and how to use the #MPB commands.
-
-
- How to edit Script Buttons
- There is a convenient shortcut: when you click on a Script Button with all
- modifiers pressed (Shift-Control-Option-Command-click), the respective script
- file is opened to the MPW Shell environment. You can then edit the script.
- When you are done with editing, save the file and select Rebuild from the
- Selection Button, to make the changes effective.
-
-
- Assigning custom icons to Script Buttons
- By placing a script file into the MPButtons folder and Rebuilding the
- MPButtons bar the script is displayed as a Script Button with a default icon.
- You can customize this icon so that you can distinguish the individual script
- buttons.
-
- To assign your own icon to a Script Button, open the script file in your
- resource editor and insert the icons for the
-
- released button state into the icon family resources with the number 10000
- pressed state into the icon family resources with the number 10001
-
- in the Script Button's resource fork. The icon family contains resources of
- type
- icl8 for eight-bit color,
- icl4 for four-bit color,
- ICN# for black & white.
-
- Do not forget to specify the mask too. The fastest way is to copy the whole
- icon family from any Script Button with custom icon. As a start try to use
- the "Funny Script Button" from More Buttons folder.
-
- During the initialization time the MPButtons core looks for these resources
- in each button. When it finds them, it will use them as the button icon,
- otherwise it will use the default icon. See the icons of the buttons you get
- along with MPButtons to see how to design an icon for a button with
- sections. Notice that a button with sections will have its respective
- depressed icon designed as if all the button sections were depressed at the
- same time.
-
-
- Assigning balloon help to Script Buttons
- Each button including a Script Button can have balloon help. To assign
- balloon help to a Script Button, put the resource 'STR#' 10000 into the
- button's resource fork. Each string in that resource will be used for one
- section balloon, corresponding to one #MPB AREA n command (see Script Button
- Example).
-
-
-
- 9.2 Code Buttons
- ————----————————
- Code Buttons are special buttons, communicating with the MPButtons core with
- a special plug-in API, similar to that of QuarkXTensions, Adobe Illustrator
- 5.0 plugins, etc. You can design your own Code Button when neither
- executable Clipboard Buttons nor Script Buttons satisfy your needs.
-
- The API features include:
- - init, exit, events, open document, close document, modified document, redraw,
- click and press input actions
- - decision which actions to get
- - the ability to be called repeatedly
- - text editing tools
- - file handling tools
- - button rectangle coordinates
-
- There are five Code Buttons that come along with MPButtons - Find, Comment,
- Function, Prototyper and Reference. Each of them was implemented as a
- plugin, using the API. You can find some additional code buttons in the More
- Buttons folder.
-
- The API (along with a sample source code) is available to developers who
- want to create their own Code Buttons. See following contacts.
-
-
-
-
- ———---—————
- 10. Contacts
- ——————---——
- Soften
- Na písku 131
- 154 00 Praha 5
- Czech Republic
-
- E-mail: buttons@login.cz
- Web: http://www.soften.cz
-
- Fax: (+42 2) 556 496 or (+42 2) 651 3618 (both 7:00am - 7:00pm GMT)
-
-
- Your feedback is welcome!
-
- —————————————————————————————————————————————————————————————————————————————
- JMP Soft was the former name of our company (since 1993 to 1996).
- Adobe Illustrator is a trademark of Adobe Systems, Inc.
- MPButtons is a trademark of Soften.
- MPW is a registered trademark of Apple Computer, Inc.
- QuarkXTension is a trademark of Quark, Inc.
- THINK Reference is a trademark of Symantec Corporation.
-
-